package net.lahuobao.mall.service.impl.admin;

import net.lahuobao.mall.dao.admin.MallOrderMapper;
import net.lahuobao.mall.entity.admin.MallOrderEntity;
import net.lahuobao.mall.service.admin.MallorderServiceI;
import org.jeecgframework.core.common.hibernate.qbc.CriteriaQuery;
import org.jeecgframework.core.common.service.impl.CommonServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service("mallorderService")
@Transactional
public class MallorderServiceImpl extends CommonServiceImpl implements MallorderServiceI {

    @Autowired
    private MallOrderMapper mapper;

    /**
     * 查询返点订单
     * @param mallOrderEntity
     * @return
     */
    @Override
    public List<MallOrderEntity> selectEcardRebateOrder(MallOrderEntity mallOrderEntity) {
        return mapper.selectEcardRebateOrder(mallOrderEntity, getPageBounds());
    }


    /**
     * 根据ids查询
     * @param ids
     * @return
     */
    @Override
    public List<MallOrderEntity> selectByIds(Integer[] ids) {
        CriteriaQuery cq = new CriteriaQuery(MallOrderEntity.class);
        cq.in("id", ids);
        cq.add();
        return super.getListByCriteriaQuery(cq, false);
    }
}